<template>
	<view>
		<u-card :title="item.title"  v-for="(item, index) in  list"
		 :key="item.id" @click="toarticle(item.id)">
			<view class="" slot="body">
				<u-image width="100%" height="300rpx" :src="item.thumbnail"></u-image>
			</view>
			<view class="" slot="foot">
				<u-icon  size="34" color="" :label="$u.timeFormat(item.time, 'yyyy年mm月dd日')"></u-icon>
			</view>
		</u-card>
	</view>
</template>

<script>
	export default {
		onLoad(obj) {
			this.key = obj.key
			this.getnewData()
		},
		data() {
			return {
				list:[],
				key:""
			}
		},
		methods: {
			getnewData() {
				this.$u.api.postcheckkey({
					key: this.key
				}).then(res => {
					console.log(res)
					this.list=[],
					this.list = res.data
				})
			},
			toarticle(id){
				this.$u.route('/pages/article/article', {
					id
				});
			}
		}
	}
</script>

<style>

</style>
